package com.audaque.springboot.foshanupload.web.raspcloud.req;

import java.io.Serializable;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import com.audaque.springboot.foshanupload.core.model.qo.page.Page;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author chinaben
 * @since 2025-06-24
 */
@Data
@Getter
@Setter
@Schema(name = "UserReq.java.java", description = "")
public class RegisterReq extends Page implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "用户账号")
    private String userName;

    @Schema(description = "用户昵称")
    private String nickName;

    // 添加密码的长度、字符限制的入参注解，在controller入参时生效
    @Schema(description = "密码")
    @NotBlank(message = "密码不能为空")
    @Size(min = 8, max = 20, message = "密码长度必须为8-20位")
    @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,20}$", message = "密码必须包含字母和数字")
    private String password;

}
